//
// Created by vcq on 21/2/25.
//
#pragma once
#include "utils_dao.hpp"
#include <string>
#include "dbng.hpp"
#include "model/judge.hpp"
#include "model/_finishrequire_goal.hpp"
#include "model/_require_syllabus.hpp"
#include "model/_syllabus_teachgoal.hpp"
#include "model/goal.hpp"
using namespace nlohmann;
using namespace std;

static void getSyllabusGoal(request& req, response& res) {
    basic_string_view<char> id = req.get_query_value("id");
    basic_string_view<char> _goal_id = req.get_query_value("_goal_id");
    basic_string_view<char> _syllabus_id = req.get_query_value("_syllabus_id");
    json item=mgetSyllabusTeachGoal(id,_goal_id,_syllabus_id);
    res.set_status_and_content(status_type::ok, item.dump(),req_content_type::json);
}
static void getSyllabusTeachGoal(request& req, response& res) {
    basic_string_view<char> id = req.get_query_value("id");
    basic_string_view<char> _teachgoal_id = req.get_query_value("_teachgoal_id");
    basic_string_view<char> _syllabus_id = req.get_query_value("_syllabus_id");
    json item=mgetSyllabusTeachGoal(id,_teachgoal_id,_syllabus_id);
    res.set_status_and_content(status_type::ok, item.dump(),req_content_type::json);
}